:: win_startup.bat
:: Adds, Removes or Checks for the specified 
:: start up script
:: Takes two arguments in the form of:
:: 		[ add ]    [ Full path to the Application ]
:: 		[ remove ] [ Application Name ]
:: 		[ check ]  [ Application Name ]
@echo off

SET command=%1
SET file=%2


IF "%command%" == "add" GOTO ADD
IF "%command%" == "remove" GOTO REMOVE
IF "%command%" == "check" GOTO CHECK
GOTO :NOARGS

:ADD
XCOPY %file% "%USERPROFILE%\Start Menu\Programs\Startup\" /Q /C /Y > NUL
IF EXIST  "%USERPROFILE%\Start Menu\Programs\Startup\MobilePrinting.exe" GOTO TRUE
GOTO FALSE

:REMOVE
IF EXIST "%USERPROFILE%\Start Menu\Programs\Startup\%file%.exe" GOTO DELETE
GOTO TRUE

:CHECK
IF EXIST "%USERPROFILE%\Start Menu\Programs\Startup\%file%.exe" GOTO TRUE
GOTO FALSE

:DELETE
DEL "%USERPROFILE%\Start Menu\Programs\Startup\%file%.exe" /Q > NUL
GOTO TRUE

:TRUE
echo True
GOTO END

:FALSE
echo False
GOTO END

:NOARGS
echo.
echo Usage: win_startup.bat [ add | remove | check ] [ Path/AppName ]
GOTO END

:END
echo.

